package com.ybkj.daijia.server.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author zhyu
 * @date 2019/5/9 10:21 desc:
 */

public class HelpPayRecord implements Serializable {

    //单个充值
    public static final int SINGE_RECHARGE = 0;
    //批量充值
    public static final int BATCH_RECHARGE = 1;
    //司机代付
    public static final int DRIVER_HELPPAY = 2;
    //司机申请提现
    public static final int DESTOON_FINANCE_CASH = 3;
    //(代付)后台驳回
    public static final int AUDIT = 4;
    // 司机支付宝充值
    public static final int DRIVER_ALI_PAY = 7;
    //司机微信充值
    public static final int DRIVER_WEIXIN_PAY = 8;
    //后台单个扣款
    public static final int SINGE_SUB = 9;
    //后台批量扣款
    public static final int BATCH_SUB = 10;
    private static final long serialVersionUID = 1L;
    private Date created;
    //司机id
    private long driverId;
    private long id;
    //金额申请改变量
    private BigDecimal changeMoney;
    //金额实际改变量
    private BigDecimal realChangeMoney;
    //操作类型,上面0,1,2,3,4
    private Integer operateType;
    //备注
    private String memo;  //如果是司机提现或审核, 这里存储了提现记录的id;
    //备用参数改成long的叫paymentRecordId;
    private String tradeNo;

    /***
     * 前端顯示的money 顔色 和正負
     * @param operateType
     * @return
     */
    public static int getRcType(int operateType) {
        switch (operateType) {
            case SINGE_RECHARGE:
            case BATCH_RECHARGE:
            case AUDIT:
            case DRIVER_ALI_PAY:
            case DRIVER_WEIXIN_PAY:
                return 0;//正
            case DRIVER_HELPPAY:
            case DESTOON_FINANCE_CASH:
            case SINGE_SUB:
            case BATCH_SUB:
                return 1;//負
        }
        return 0;
    }

    /***
     * 前端顯示的中文分類
     * @param operateType
     * @return
     */
    public static String getRecordTypeStr(Integer operateType) {
        if (null == operateType) {
            return null;
        }
        switch (operateType) {
            case SINGE_RECHARGE:
            case BATCH_RECHARGE:
                return "后台充值代付";
            case DRIVER_HELPPAY:
                return "代付扣款";
            case DESTOON_FINANCE_CASH:
                return "申请可代付提现";
            case AUDIT:
                return "申请可代付提现驳回";
            case DRIVER_ALI_PAY:
                return "支付宝充值代付";
            case DRIVER_WEIXIN_PAY:
                return "微信充值代付";
            case SINGE_SUB:
            case BATCH_SUB:
                return "后台扣除代付";
        }
        return null;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public long getDriverId() {
        return driverId;
    }

    public void setDriverId(long driverId) {
        this.driverId = driverId;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    @Override
    public String toString() {
        return "HelpPayRecord{" +
            "created=" + created +
            ", driverId=" + driverId +
            ", id=" + id +
            ", changeMoney=" + changeMoney +
            ", realChangeMoney=" + realChangeMoney +
            ", operateType=" + operateType +
            ", memo='" + memo + '\'' +
            ", tradeNo='" + tradeNo + '\'' +
            '}';
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public BigDecimal getChangeMoney() {
        return changeMoney;
    }

    public void setChangeMoney(BigDecimal changeMoney) {
        this.changeMoney = changeMoney;
    }

    public BigDecimal getRealChangeMoney() {
        return realChangeMoney;
    }

    public void setRealChangeMoney(BigDecimal realChangeMoney) {
        this.realChangeMoney = realChangeMoney;
    }

    public Integer getOperateType() {
        return operateType;
    }

    public void setOperateType(Integer operateType) {
        this.operateType = operateType;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }
}
